gridpack::parallel::TaskManager Class Reference

#include <task_manager.hpp>

List of all members.

Public Member Functions

 TaskManager (void)
 TaskManager (Communicator &comm)
 ~TaskManager (void)
void set (int ntasks)
bool nextTask (int *next)
bool nextTask (Communicator &comm, int *next)
void cancel (void)
void printStats ()

Constructor & Destructor Documentation

gridpack::parallel::TaskManager::TaskManager ( void   ) 

Constructor on world communicator

gridpack::parallel::TaskManager::TaskManager ( Communicator comm  ) 

Constructor that uses user-specified communicator

Parameters:
comm user-specified communicator

References gridpack::parallel::Communicator::getGroup().

gridpack::parallel::TaskManager::~TaskManager ( void   ) 

Destructor


Member Function Documentation

void gridpack::parallel::TaskManager::cancel ( void   ) 

Set the task counter to the maximum value so that all subsequent calls to nextTask return false. NOTE: nextTask must be called at least once by any process that calls this function or the counter will hang

bool gridpack::parallel::TaskManager::nextTask ( Communicator comm,
int *  next 
)

Get the next task for the whole communicator. The same value of next is returned for all processors in the communicator comm. If the manager finds a task it returns true and next is set to the index of the task, otherwise it returns false and next is set to -1

Parameters:
comm communicator for next task
next index of next task
Returns:
false if no other tasks are found

References gridpack::parallel::Communicator::getGroup(), and gridpack::parallel::Communicator::rank().

bool gridpack::parallel::TaskManager::nextTask ( int *  next  ) 

Get the next task from the task manager. If the manager finds a task it returns true and next is set to the index of the task, otherwise it returns false and next is set to -1

Parameters:
next index of next task
Returns:
false if no other tasks are found
void gridpack::parallel::TaskManager::printStats (  ) 

Print out statistics on how tasks are distributed on processors

void gridpack::parallel::TaskManager::set ( int  ntasks  ) 

Specify total number of tasks and set task manager to zero

Parameters:
ntasks total number of tasks

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 3 Feb 2020 for GridPACK by  doxygen 1.6.1